import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

/**
 * broadcast模块-背景音频
 */
@Entity('broadcast_audio')
export class BroadcastAudioEntity extends BaseEntity {
  @Column({ comment: '音频名称' })
  name: string;

  @Column({ comment: '音频封面', nullable: true })
  cover: string;

  @Column({ comment: '音频作者', nullable: true })
  author: string;

  @Column({ comment: '音频链接', nullable: true })
  url: string;

  @Column({ comment: '播放次数', default: 0 })
  playCount: number;

  @Column({
    comment: '音频时长-秒', default: 0, type: 'decimal',
    precision: 10,
    scale: 2,
  })
  duration: number;

  @Column({ comment: '是否默认', default: 0 })
  isDefault: number;
}
